use axum::body::Body;
use axum::http::{Request, StatusCode};
use super::*;

#[tokio::test]
async fn test_login() {
    let app = routes::auth_router();
    let response = app
        .oneshot(
            Request::builder()
                .uri("/auth/login")
                .method("POST")
                .header("Content-Type", "application/json")
                .body(Body::from(r#"{"email":"test@test.com","password":"123456"}"#))
                .unwrap(),
        )
        .await
        .unwrap();

    assert_eq!(response.status(), StatusCode::OK);
}